package se.webbzon.boltzmann.battle.strategy.playerstrategy;

import java.awt.Color;
import java.awt.Image;

public abstract class AbstractPSIcon {
	
	// The default color of the icon text
	private static final Color defaultColor = Color.white;
	
	// The icon image
	private final Image image;
	
	// The icon text
	private final String text;
	
	// The icon text color
	private final Color color;
	
	/*============================================================
	Constructors
	============================================================*/
	
	public AbstractPSIcon(Image image, String text) {
		this(image,text,defaultColor);
	}
	
	public AbstractPSIcon(Image image, String text, Color color) {
		this.image = image;
		this.text = text;
		this.color = color;
	}
	
	/*============================================================
	Public Methods
	============================================================*/
	
	/** Returns true if this icon is available for selection. **/
	public abstract boolean isAvailable();
	
	/** Returns a message (as a string) containing the reason why
	 * this icon is unavailable. **/
	public abstract String getUnavailableMessage();
	
	/** This method is invoked when the player selects this icon
	 * by pressing it during highlight in a player strategy page. **/
	public abstract void onSelect(	PlayerStrategyHud psh, 
									AbstractPSPage page);
	
	/** Returns the description of this player strategy icon. **/
	public abstract String getDescription();
	
	/** Returns the image of this player strategy icon. **/
	public Image getImage() {
		return image;
	}
	
	/** Returns the text of this player strategy icon. **/
	public String getText() {
		return text;
	}
	
	/** Returns the text color of this player strategy icon. **/
	public Color getTextColor() {
		return color;
	}

}
